package action;

import biz.AdminBiz;
import biz.DoctorBiz;
import biz.UserBiz;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class AdminLoginAction extends ActionSupport {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String adminNick;
	private String adminPassword;
	
	
	public String getAdminNick() {
		return adminNick;
	}


	public void setAdminNick(String adminNick) {
		this.adminNick = adminNick;
	}


	public String getAdminPassword() {
		return adminPassword;
	}


	public void setAdminPassword(String adminPassword) {
		this.adminPassword = adminPassword;
	}


	public String login(){
		AdminBiz adminBiz=new AdminBiz();
		if(adminBiz.checkAdminLogin(adminNick, adminPassword)){
			ActionContext ac=ActionContext.getContext();
			ac.getSession().put("adminNick", adminNick);
			return SUCCESS;
		}
		return INPUT;
	}

}
